package cn.com.taiji.oospub.wechat.entity;

import cn.com.taiji.entity.StringUUIDEntity;
import cn.com.taiji.oospub.wechat.common.Finals;
import com.baomidou.mybatisplus.annotation.TableField;
import com.github.dreamyoung.mprelation.EntityMapper;
import com.github.dreamyoung.mprelation.JoinColumn;
import com.github.dreamyoung.mprelation.ManyToOne;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *
 * </p>
 *
 * @author yzd
 * @since 2020-10-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class CoursesOrdersDetails extends StringUUIDEntity implements Serializable {

    private static final long serialVersionUID = 1L;


    private String orderId;


    @TableField(exist = false)
    @ManyToOne
    @EntityMapper
    @JoinColumn(name = "order_id", referencedColumnName = "id")
    private CoursesOrders mainOrder;

    private String courseId;

    @TableField(exist = false)
    @ManyToOne
    @EntityMapper
    @JoinColumn(name = "course_id", referencedColumnName = "id")
    private Courses course;

    private Double quantity;

    private Double price;

    private String creator;

    @TableField(exist = false)
    @ManyToOne
    @EntityMapper
    @JoinColumn(name = "creator", referencedColumnName = "id")
    private MemberBaseInfo creatorInfo;


    private LocalDateTime lastChanged;

    private String remark = "";

    private Integer isRefunding;

    private Boolean isEffective;

    private String mealId;

    @TableField(exist = false)
//    @EntityMapper
//    @ManyToOne
//    @JoinColumn(name = "meal_id",referencedColumnName = "id")
    private MealTime mealTime;

    @TableField("meal_Name")
    private String mealName;

    private Finals.MealType lb;

    private String mealCode;

//    private String courseStandardId="0";//默认没有匹配规格

//    @TableField(exist = false)
//    @EntityMapper
//    @ManyToOne
//    @JoinColumn(name = "course_standard_id",referencedColumnName = "id")
//    private CourseStandard courseStandard;

    //临时字段
    @TableField(exist = false)
    private String qucanStartTime;
    @TableField(exist = false)
    private String qucanEndTime;
    @TableField(exist = false)
    private String quantityStr;
    @TableField(exist = false)
    private String courseName;
    @TableField(exist = false)
    private String courseNameEn;
    @TableField(exist = false)
    private String priceStr;
    @TableField(exist = false)
    private Double totalPrice;
    @TableField(exist = false)
    private String posNo;
    @TableField(exist = false)
    private String imageMainPath;
    @TableField(exist = false)
    private List<CourseNutrition> nutList;
    @TableField(exist = false)
    private Map<String, Double> nutMap;

}
